cmake_minimum_required(VERSION 3.20 FATAL_ERROR)

# project name and language
project(ModelboxAI LANGUAGES C CXX)

# we default to Release build type
if(NOT CMAKE_BUILD_TYPE)
    set(CMAKE_BUILD_TYPE Debug CACHE STRING "Build type" FORCE)
endif()
message(STATUS "Build type: ${CMAKE_BUILD_TYPE}")

set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_EXTENSIONS OFF)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

include(GNUInstallDirs)
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${PROJECT_SOURCE_DIR}/output/${CMAKE_INSTALL_LIBDIR})
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${PROJECT_SOURCE_DIR}/output/${CMAKE_INSTALL_LIBDIR})
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${PROJECT_SOURCE_DIR}/output/${CMAKE_INSTALL_BINDIR})

set(LIBRARY_PATH ${PROJECT_SOURCE_DIR}/3rdparty)

# compiler flags
list(APPEND flags "-fPIC" "-Wall")

if(NOT WIN32)
    list(APPEND flags "-Wextra" "-Wpedantic")
endif()

if( "${CMAKE_BUILD_TYPE}" STREQUAL "Debug" )
    list(APPEND flags "-g")
else()
    list(APPEND flags "-o2")
endif()


add_subdirectory(src)







